import utils from './utils';

const baby = {
    ...utils
};
const install = function (Vue, options) {
    if (options && options.cachePrefix) {

        baby.setLocal = (key, val) => {
            return utils.setLocal(`${options.cachePrefix}-${key}`, val);
        };

        baby.getLocal = (key) => {
            return utils.getLocal(`${options.cachePrefix}-${key}`);
        };
        baby.deleteLocal = (key) => {
            return utils.deleteLocal(`${options.cachePrefix}-${key}`);
        }
    }

    Vue.prototype.$baby = baby;
};

baby.install = install;

export default baby;


